/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Serif+SC:wght@400;700&display=swap');

body {
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, #ffccd5 0%, #ffb6c1 50%, #ffc0cb 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    touch-action: manipulation;
}

.hidden {
    display: none !important;
}

/* 封面样式 */
.card-cover {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
    transition: all 0.5s ease-in-out;
}

.cover-title {
    font-family: 'Ma Shan Zheng', cursive;
    color: #ff4081;
    font-size: 2.2rem;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: glow 2s ease-in-out infinite alternate;
}

.cover-hint {
    font-size: 1.1rem;
    color: #ff6b6b;
    animation: pulse 1.5s ease-in-out infinite;
    margin-top: 20px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* 贺卡容器 */
.card-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    z-index: 1;
    animation: fadeIn 0.8s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.birthday-card {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding: 40px;
    position: relative;
    text-align: center;
    transition: transform 0.3s ease;
}

.birthday-card:hover {
    transform: translateY(-5px);
}

/* 标题样式 */
.card-title {
    font-family: 'Ma Shan Zheng', cursive;
    color: #ff4081;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #fff, 0 0 10px #ff4081, 0 0 15px #ff4081;
    }
    to {
        text-shadow: 0 0 10px #fff, 0 0 20px #ff4081, 0 0 30px #ff4081;
    }
}

/* 内容样式 */
.card-content {
    max-width: 600px;
    margin: 0 auto 40px;
}

.greeting {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.message p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: justify;
}

/* 气球样式 */
.balloon-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
}

.balloon {
    position: absolute;
    width: 40px;
    height: 50px;
    border-radius: 50%;
    animation: float 15s ease-in-out infinite;
    pointer-events: auto;
    z-index: 10;
}

.balloon::before {
    content: "";
    position: absolute;
    width: 4px;
    height: 80px;
    background: rgba(200, 200, 200, 0.5);
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
}

.balloon-1 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    top: -30px;
    left: 10%;
    animation-delay: 0s;
}

.balloon-2 {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    top: -20px;
    left: 30%;
    animation-delay: 2s;
}

.balloon-3 {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    top: -40px;
    right: 30%;
    animation-delay: 1s;
}

.balloon-4 {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    top: -25px;
    right: 10%;
    animation-delay: 3s;
}

.balloon-5 {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
    top: -35px;
    left: 50%;
    animation-delay: 2.5s;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-100px) rotate(10deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

.balloon.fly-away {
    animation: flyAway 3s ease-in-out forwards;
}

@keyframes flyAway {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-500px) rotate(20deg);
        opacity: 0;
    }
}

/* 蛋糕样式 - 封面蛋糕 */
.cake-container {
    position: relative;
    height: 220px;
    margin-bottom: 40px;
    cursor: pointer;
    transition: transform 0.3s ease;
    perspective: 1000px;
}

.cake-container:hover {
    transform: scale(1.05);
}

.cake-container:active {
    transform: scale(0.98);
}

.cake {
    position: relative;
    width: 180px;
    height: 160px;
    transform-style: preserve-3d;
    margin: 0 auto;
}

.cake-bottom {
    position: absolute;
    width: 180px;
    height: 60px;
    background: linear-gradient(to right, #f3e9d2 0%, #f8f3e3 50%, #f3e9d2 100%);
    border-radius: 10px;
    bottom: 0;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    border: 1px solid #e6d5b8;
}

.cake-middle {
    position: absolute;
    width: 160px;
    height: 50px;
    background: linear-gradient(to right, #f9c5d1 0%, #f7c0d0 50%, #f9c5d1 100%);
    border-radius: 10px;
    bottom: 60px;
    left: 10px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    border: 1px solid #f5b6c6;
    background-image: 
        repeating-linear-gradient(90deg, 
            transparent, 
            transparent 10px, 
            rgba(255,255,255,0.1) 10px, 
            rgba(255,255,255,0.1) 20px);
}

.cake-top {
    position: absolute;
    width: 140px;
    height: 50px;
    background: linear-gradient(to right, #f8d9e3 0%, #fae7ed 50%, #f8d9e3 100%);
    border-radius: 10px;
    bottom: 110px;
    left: 20px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    border: 1px solid #f5cad9;
    background-image: 
        radial-gradient(circle at 40px 25px, rgba(255,255,255,0.2) 2px, transparent 2px),
        radial-gradient(circle at 70px 15px, rgba(255,255,255,0.2) 2px, transparent 2px),
        radial-gradient(circle at 100px 25px, rgba(255,255,255,0.2) 2px, transparent 2px);
}

.candle {
    position: absolute;
    width: 10px;
    height: 30px;
    background: linear-gradient(to right, #f5d6e6 0%, #fdeeee 50%, #f5d6e6 100%);
    border-radius: 5px;
    bottom: 160px;
    left: 85px;
    box-shadow: 0 0 5px rgba(255,192,203,0.5);
    z-index: 2;
}

.flame {
    position: absolute;
    width: 14px;
    height: 20px;
    background: radial-gradient(ellipse at center, #ffef9b 0%, #ffdb5b 40%, #ff9d00 100%);
    border-radius: 8px 8px 12px 12px;
    bottom: 30px;
    left: -2px;
    box-shadow: 0 0 10px #ff9d00, 0 0 20px #ff9d00, 0 0 30px #ff9d00;
    transform-origin: center bottom;
    animation: flicker 0.8s ease-in-out infinite alternate;
    filter: blur(0.5px);
}

@keyframes flicker {
    0%, 100% {
        transform: scaleX(1) scaleY(1) rotate(2deg);
        opacity: 1;
    }
    25% {
        transform: scaleX(0.95) scaleY(1.05) rotate(-1deg);
        opacity: 0.9;
    }
    50% {
        transform: scaleX(1.05) scaleY(0.95) rotate(3deg);
        opacity: 1;
    }
    75% {
        transform: scaleX(0.98) scaleY(1.02) rotate(0deg);
        opacity: 0.9;
    }
}

/* 礼物盒样式 */
.surprise-btn-container {
    margin: 30px auto;
    position: relative;
    width: 160px;
    height: 160px;
    perspective: 1000px;
}

.gift-box {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition: transform 0.8s;
    cursor: pointer;
}

.gift-box:hover {
    transform: rotateY(10deg) rotateX(5deg) scale(1.05);
}

.gift-box:active {
    transform: rotateY(0deg) rotateX(0deg) scale(0.95);
}

.gift-box-body {
    position: absolute;
    width: 100%;
    height: 75%;
    bottom: 0;
    background: linear-gradient(135deg, #ff6b6b, #ff9d9d);
    border-radius: 5px;
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
}

.gift-box-top {
    position: absolute;
    width: 110%;
    height: 25%;
    left: -5%;
    top: 0;
    background: linear-gradient(to right, #ff8080, #ff6b6b);
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
    transform-origin: bottom;
    transition: transform 0.5s ease-in-out;
}

.gift-box.open .gift-box-top {
    transform: rotateX(-110deg);
}

.gift-ribbon-vertical {
    position: absolute;
    width: 15%;
    height: 100%;
    left: 42.5%;
    background: #ffdd57;
    z-index: 3;
}

.gift-ribbon-horizontal {
    position: absolute;
    width: 100%;
    height: 15%;
    top: 30%;
    background: #ffdd57;
    z-index: 3;
}

.gift-box-label {
    position: absolute;
    width: 100%;
    text-align: center;
    bottom: -40px;
    font-size: 1.1rem;
    color: #ff4081;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gift-box:hover .gift-box-label {
    transform: scale(1.1);
    color: #ff2c70;
}

/* 惊喜内容样式 */
#surprise-message {
    margin-top: 30px;
    transition: all 0.5s ease;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

#surprise-message.show {
    opacity: 1;
    height: auto;
    animation: popUp 0.8s ease-out;
    padding: 20px 0;
}

@keyframes popUp {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    80% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 惊喜蛋糕样式 */
.surprise-cake-container {
    position: relative;
    height: 260px;
    margin: 40px auto;
    width: 260px;
    perspective: 1000px;
}

.surprise-cake {
    position: relative;
    width: 220px;
    height: 180px;
    margin: 0 auto;
    transform-style: preserve-3d;
}

.surprise-cake-bottom {
    position: absolute;
    width: 220px;
    height: 70px;
    background: linear-gradient(to right, #f3e9d2 0%, #f8f3e3 50%, #f3e9d2 100%);
    border-radius: 12px;
    bottom: 0;
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    border: 1px solid #e6d5b8;
    background-image: 
        repeating-linear-gradient(90deg, 
            transparent, 
            transparent 15px, 
            rgba(226,207,176,0.2) 15px, 
            rgba(226,207,176,0.2) 30px);
}

.surprise-cake-middle {
    position: absolute;
    width: 200px;
    height: 60px;
    background: linear-gradient(to right, #f9c5d1 0%, #f7c0d0 50%, #f9c5d1 100%);
    border-radius: 12px;
    bottom: 70px;
    left: 10px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    border: 1px solid #f5b6c6;
    background-image: 
        linear-gradient(90deg, 
            transparent 50%, 
            rgba(255,255,255,0.1) 50%),
        linear-gradient(90deg, 
            rgba(255,192,203,0.2) 50%, 
            transparent 50%);
    background-size: 20px 100%, 20px 100%;
}

.surprise-cake-top {
    position: absolute;
    width: 180px;
    height: 50px;
    background: linear-gradient(to right, #f8d9e3 0%, #fae7ed 50%, #f8d9e3 100%);
    border-radius: 12px;
    bottom: 130px;
    left: 20px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    border: 1px solid #f5cad9;
    background-image: 
        radial-gradient(circle at 30px 25px, rgba(255,182,198,0.3) 4px, transparent 4px),
        radial-gradient(circle at 60px 15px, rgba(255,182,198,0.3) 4px, transparent 4px),
        radial-gradient(circle at 90px 25px, rgba(255,182,198,0.3) 4px, transparent 4px),
        radial-gradient(circle at 120px 15px, rgba(255,182,198,0.3) 4px, transparent 4px),
        radial-gradient(circle at 150px 25px, rgba(255,182,198,0.3) 4px, transparent 4px);
}

.surprise-candle-container {
    position: absolute;
    width: 100%;
    top: -20px;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 2;
}

.surprise-candle {
    position: relative;
    width: 10px;
    height: 40px;
    background: linear-gradient(90deg, #f5d6e6, #fdeeee 50%, #f5d6e6);
    border-radius: 5px;
    margin: 0 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transform: rotate(var(--rotate, 0deg));
}

.candle-1 {
    --rotate: -5deg;
    height: 45px;
}

.candle-2 {
    --rotate: 2deg;
    height: 38px;
}

.candle-3 {
    --rotate: -2deg;
    height: 42px;
}

.candle-4 {
    --rotate: 5deg;
    height: 36px;
}

.candle-5 {
    --rotate: -3deg;
    height: 40px;
}

.surprise-flame {
    position: absolute;
    width: 16px;
    height: 25px;
    background: radial-gradient(ellipse at center, #ffef9b 0%, #ffdb5b 40%, #ff9d00 100%);
    border-radius: 8px 8px 12px 12px;
    top: -25px;
    left: -3px;
    box-shadow: 0 0 15px #ff9d00, 0 0 25px #ff9d00, 0 0 30px #ffdb5b;
    transform-origin: center bottom;
    animation: flicker 0.8s ease-in-out infinite alternate;
    filter: blur(0.5px);
    z-index: 5;
}

.surprise-flame.blown {
    opacity: 0;
    transform: scaleY(0.1);
    transition: all 0.3s ease;
    box-shadow: none;
}

/* 滑动提示 */
.swipe-hint {
    position: absolute;
    bottom: -35px;
    width: 100%;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
    color: #ff6b6b;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.swipe-hint i {
    animation: slide 1.5s ease-in-out infinite;
}

.swipe-hint i:first-child {
    animation-delay: 0.2s;
}

@keyframes slide {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

/* 心形和闪光效果 */
.heart-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 30px auto;
}

.heart {
    width: 50px;
    height: 50px;
    background-color: #ff6b6b;
    position: absolute;
    top: 25px;
    left: 25px;
    transform: rotate(45deg);
    animation: heartbeat 1.5s ease-in-out infinite;
}

.heart::before,
.heart::after {
    content: "";
    width: 50px;
    height: 50px;
    position: absolute;
    border-radius: 50%;
    background-color: #ff6b6b;
}

.heart::before {
    top: -25px;
    left: 0;
}

.heart::after {
    top: 0;
    left: -25px;
}

.sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ffdd57;
    opacity: 0;
}

.sparkle-1 {
    top: 0;
    left: 45px;
    animation: sparkle 2s ease-in-out infinite;
}

.sparkle-2 {
    top: 45px;
    left: 0;
    animation: sparkle 2s ease-in-out 0.4s infinite;
}

.sparkle-3 {
    top: 45px;
    right: 0;
    animation: sparkle 2s ease-in-out 0.8s infinite;
}

.sparkle-4 {
    bottom: 0;
    left: 30px;
    animation: sparkle 2s ease-in-out 1.2s infinite;
}

.sparkle-5 {
    bottom: 0;
    right: 30px;
    animation: sparkle 2s ease-in-out 1.6s infinite;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes heartbeat {
    0% {
        transform: rotate(45deg) scale(0.8);
    }
    5% {
        transform: rotate(45deg) scale(0.85);
    }
    10% {
        transform: rotate(45deg) scale(0.9);
    }
    15% {
        transform: rotate(45deg) scale(0.85);
    }
    20% {
        transform: rotate(45deg) scale(0.8);
    }
    100% {
        transform: rotate(45deg) scale(0.8);
    }
}

/* 诗句样式 */
.surprise-poem {
    margin: 30px auto;
    padding: 15px;
    max-width: 300px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.surprise-poem h3 {
    color: #ff4081;
    margin-bottom: 10px;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.5rem;
}

.surprise-poem p {
    line-height: 1.8;
    color: #555;
    font-size: 1.1rem;
}

/* 惊喜文字信息 */
.surprise-message-text {
    margin-top: 20px;
}

.surprise-message-text p {
    font-size: 1.1rem;
    color: #ff4081;
    margin-bottom: 15px;
    line-height: 1.6;
}

.wish-text {
    font-size: 1.2rem !important;
    color: #ff4081;
    font-weight: bold;
    margin-top: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.wish-text.show {
    opacity: 1;
}

/* 按钮样式 */
.back-btn {
    background: linear-gradient(45deg, #757575, #9e9e9e);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    font-family: 'Noto Serif SC', serif;
    font-size: 1rem;
    font-weight: bold;
    padding: 10px 25px;
    margin: 30px auto 10px;
    transition: all 0.3s ease;
    display: block;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.back-btn:hover, .back-btn:active {
    background: linear-gradient(45deg, #9e9e9e, #757575);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.back-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* 控制按钮 */
.music-control, .theme-toggle, .share-btn {
    position: fixed;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.music-control {
    top: 20px;
    right: 20px;
}

.theme-toggle {
    top: 20px;
    left: 20px;
}

.share-btn {
    bottom: 20px;
    right: 20px;
}

.music-control i, .theme-toggle i, .share-btn i {
    font-size: 1.3rem;
    color: #ff6b6b;
}

.music-control:hover, .theme-toggle:hover, .share-btn:hover,
.music-control:active, .theme-toggle:active, .share-btn:active {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.9);
}

.music-control.playing i {
    animation: rotating 2s linear infinite;
    color: #ff4081;
}

@keyframes rotating {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 烟火画布 */
#fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* 主题样式 */
body.theme-blue {
    background: linear-gradient(135deg, #c2e9fb 0%, #a1c4fd 50%, #8fd3f4 100%);
}

body.theme-purple {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 50%, #c2e9fb 100%);
}

body.theme-green {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 50%, #84fab0 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .card-container {
        padding: 10px;
    }
    
    .birthday-card {
        padding: 25px;
    }
    
    .card-title {
        font-size: 2rem;
    }
    
    .greeting {
        font-size: 1.1rem;
    }
    
    .message p {
        font-size: 0.95rem;
    }
    
    .cover-title {
        font-size: 1.8rem;
        padding: 0 20px;
    }
    
    .cake {
        transform: translateX(-50%) scale(0.9);
    }
    
    .surprise-cake {
        transform: translateX(-50%) scale(0.85);
    }
}

@media (max-width: 480px) {
    .birthday-card {
        padding: 20px 15px;
    }
    
    .card-title {
        font-size: 1.7rem;
        margin-bottom: 20px;
    }
    
    .greeting {
        font-size: 1rem;
    }
    
    .message p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .cover-title {
        font-size: 1.6rem;
        padding: 0 15px;
    }
    
    .cake {
        transform: translateX(-50%) scale(0.8);
    }
    
    .music-control, .theme-toggle, .share-btn {
        width: 40px;
        height: 40px;
    }
    
    .music-control i, .theme-toggle i, .share-btn i {
        font-size: 1.1rem;
    }
    
    .surprise-cake {
        transform: translateX(-50%) scale(0.8);
    }
    
    .swipe-hint {
        font-size: 0.9rem;
    }
} 